export MY_TOP_PATH=/home/sonvhi/chenxiaosong/
export MY_CODE_TOP_PATH=${MY_TOP_PATH}/code/

# Get the aliases and functions
# if [ -f ~/.bashrc ]; then
#         . ~/.bashrc
# fi

sw_path=${MY_TOP_PATH}/sw/
cscope_path=${MY_TOP_PATH}/code/cscope/contrib/xcscope/
re2c_path=${MY_TOP_PATH}/sw/re2c/bin/
qemu_path=${MY_TOP_PATH}/sw/qemu/bin/
autossh_path=${MY_TOP_PATH}/sw/autossh/bin/
nodejs_path=${MY_TOP_PATH}/sw/nodejs/bin/
dotnet_path=${MY_TOP_PATH}/sw/dotnet
gdb_path=${MY_TOP_PATH}/sw/gdb/bin
crash_path=${MY_TOP_PATH}/code/crash
wine_path=${MY_TOP_PATH}/sw/wine/bin
# gcc_path=${MY_TOP_PATH}/sw/gcc/bin/
export GOROOT=${MY_TOP_PATH}/sw/go1.18.3.linux-amd64
export PATH=${wine_path}:${crash_path}:$GOROOT/bin:$cscope_path:$sw_path:$re2c_path:$qemu_path:$autossh_path:${nodejs_path}:$gcc_path:${dotnet_path}:${gdb_path}:$PATH

# 设置 terminal 标签名称， 用法: title tab name
# 只用于ubuntu默认的terminal，因为ubuntu默认的terminal无法通过鼠标来改标签标题
function title() {
	if [[ -z "$ORIG" ]]; then
		ORIG=$PS1
	fi
	TITLE="\[\e]2;$*\a\]"
	PS1=${ORIG}${TITLE}
}

stty -ixon # 搜索历史命令，ctrl + s不锁屏
source /usr/share/bash-completion/completions/git # docker中要先安装 apt install bash-completion -y
# 只显示最后一个路径名分量
PS1="${PS1//\\w\\$/\\W\\$}"